@echo off
chcp 65001
setlocal enabledelayedexpansion
set /p commit=提交内容：

set "GIT_PULL_OUTPUT="
 
for /F "delims=" %%i in ('git pull 2^>^&1') do (
    set "GIT_PULL_OUTPUT=!GIT_PULL_OUTPUT!%%i"
    echo %%i
)
echo git pull:
echo %GIT_PULL_OUTPUT%

set "GIT_ADD_OUTPUT="
 
for /F "delims=" %%i in ('git add . 2^>^&1') do (
    set "GIT_ADD_OUTPUT=!GIT_ADD_OUTPUT!%%i"
    echo %%i
)
echo git add:
echo %GIT_ADD_OUTPUT%

set "GIT_COMMIT_OUTPUT="
 
for /F "delims=" %%i in ('git commit -m "%commit%" 2^>^&1') do (
    set "GIT_COMMIT_OUTPUT=!GIT_COMMIT_OUTPUT!%%i"
    echo %%i
)
echo git commit :
echo %GIT_COMMIT_OUTPUT%

set "GIT_PUSH_OUTPUT="
 
for /F "delims=" %%i in ('git push 2^>^&1') do (
    set "GIT_PUSH_OUTPUT=!GIT_PUSH_OUTPUT!%%i"
    echo %%i
)
echo git push:
echo %GIT_PUSH_OUTPUT%
pause